<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS-DEMO</title>
    <style>
        body{
            background-color: #f5f5f5;
        }
        .border1{
            width: 60px;
            height: 10px;
            border-top: 30px double #333;
            border-bottom: 10px solid #333;
        }
        .border2{
            position: relative;
            width: 60px;
            height: 60px;
            border: 2px dotted;
        }
        .border2::before{
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
            width: 20px;
            height: 0;
            border-bottom: 4px solid;
        }
        .border2:hover{
            color: red;
        }
        .border3{
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 60px 80px;
            border-color: red transparent transparent transparent;
        }
        .border4{
            width: 40px;
            height: 40px;
            border-style: solid;
            border-width: 60px;
            border-color: red yellow blue green;
        }

        .padding1 span{
            border-left: 2px solid;
            padding: 10px 3px 1px;
            margin-left: 6px;
            font-size: 0;
        }
        .padding2{
            width: 100px;
        }
        .padding2 div{
            padding-bottom: 56.25%;
            background: green;
        }
        .padding3{
            width: 60px;
            height: 10px;
            padding: 10px 0;
            border-top: 10px solid;
            border-bottom: 10px solid;
            background-color: currentColor;
            background-clip: content-box;
        }
        .padding4{
            width: 40px;
            height: 40px;
            border-radius: 50%;
            padding: 10px;
            border: 10px solid;
            background-color: currentColor;
            background-clip: content-box;
        }

        .margin1{
            position: relative;
            width: 100px;
            height: 100px;
            background: green;
        }
        .margin1::before{
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            width: 60px;
            height: 60px;
            margin: auto;
            background: red;
        }

        .verticle1{
            line-height: 100px;
            width: 100px;
            text-align: center;
            background: red;
        }
        .verticle1 img{
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <h2>1.border</h2>
    <h3>利用border-style double实现三条杠</h3>
    <div class="border1"></div>
    <h3>利用border-color默认值实现hover时文字边框同时变色</h3>
    <div class="border2">文字</div>
    <h3>利用border-color透明实现三角形</h3>
    <div class="border3"></div>
    <div class="border4"></div>

    <h2>2.padding</h2>
    <h3>内联元素padding实现分割线</h3>
    <div class="padding1">
        注册<span></span>登录
    </div>
    <h3>padding百分比实现响应式矩形</h3>
    <div class="padding2"><div></div></div>
    <h3>padding实现三条杠和radio选中样式</h3>
    <div class="padding3"></div>
    <div class="padding4"></div>

    <h2>3.margin</h2>
    <h3></h3>
    <div class="margin1"></div>
    <h2>4.z-index</h2>
    <h3></h3>
    <div class="margin2"></div>
    <h3></h3>
    <div class="margin3"></div>
    <h3></h3>
    <div class="margin4"></div>
    <h3></h3>
    <div class="margin5"></div>
    <h2>5.verticle-align</h2>
    <h3>图片水平垂直居中</h3>
    <div class="verticle1">
        <img src="../dog.png" alt="">
    </div>
</body>
</html>